央视合集[央].js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. var rule = {
  2. title:'央视频',
  3. host:'https://api.cntv.cn',
  4. homeUrl: '/lanmu/columnSearch?&fl=&fc=&cid=&p=1&n=500&serviceId=tvcctv&t=json',
  5. url:'/lanmu/columnSearch?&fl=&fc=fyclass&cid=&p=fypage&n=500&serviceId=tvcctv&t=json',
  6. searchUrl:'',
  7. searchable:0,
  8. quickSearch:0,
  9. class_name: '影视&New闻&体育&综艺&健康&生活&科教&法治&军事&少儿&动画&音乐&戏曲',
  10. class_url:'电影电视剧&新闻&体育&综艺&健康&生活&科教&法治&军事&少儿&动画&音乐&戏曲',
  11. filterable: 1,
  12. headers:{
  13. 'User-Agent':'PC_UA'
  14. },
  15. timeout:10000,
  16. play_parse:true,
  17. limit:6,
  18. double:false,
  19. lazy: $js.toString(() => {
  20. input=JSON.parse(request('https://vdn.apps.cntv.cn/api/getHttpVideoInfo.do?pid='+input)).hls_url.replaceAll('main','2000')
  21. .replaceAll('cntv.lxdns','cntv.myalicdn').replaceAll('n.cn','n.com').replaceAll('myhwcdn','myalicdn').replaceAll('kcdnvip','myalicdn').replaceAll('newcntv.qcloudcdn','cntv.myalicdn')
  22. ;
  23. }),
  24. 一级: $js.toString(() => {
  25. var d = [];
  26. var list = JSON.parse(request(input)).response.docs;
  27. list.forEach(it => {
  28. let guid1 = it.lastVIDE.videoSharedCode;
  29. // 一级标题
  30. let title1 = it.column_name;
  31. // 一级描述
  32. let desc1 = it.channel_name;
  33. // 一级图片URL
  34. let picUrl1 = it.column_logo;
  35. // 一级URL(id 地区 类型 标题 演员 年份 频道 简介 图片 更新至)
  36. let url1 = it.lastVIDE.videoSharedCode + '|' + it.column_firstclass + '|' + it.column_name + '|' + it.column_playdate + '|' + it.channel_name + '|' + it.column_brief + '|' + it.column_logo + '|' + it.lastVIDE.videoTitle;
  37. d.push({
  38. desc : desc1,
  39. title : title1,
  40. pic_url : picUrl1,
  41. url : url1
  42. })
  43. })
  44. setResult(d);
  45. }),
  46. 二级: $js.toString(() => {
  47. let info = input.split("|");
  48. VOD = {
  49. vod_id: info[1],
  50. vod_name: info[3],
  51. vod_pic: info[8],
  52. type_name: info[2],
  53. vod_year: info[2],
  54. vod_area: info[1],
  55. vod_remarks: info[7],
  56. vod_director: 'ƪ(˘⌣˘)ʃ优雅',
  57. vod_actor: 'ƪ(˘⌣˘)ʃ优雅',
  58. vod_content: info[5],
  59. };
  60. var modeMap = {
  61. "健康": "0",
  62. "综艺": "0",
  63. "体育": "0",
  64. "动画": "1",
  65. };
  66. var ctid = info[0].replace('https://api.cntv.cn/lanmu/','');
  67. var link = 'https://api.cntv.cn/NewVideo/getVideoListByAlbumIdNew?id='+ctid+'&serviceId=tvcctv&p=1&n=100&mode='+modeMap[info[11]]+'&pub=1';
  68. var html = JSON.parse(request(link));
  69. var playUrls;
  70. if(html.errcode==='1001'){
  71. var guid = info[0].replace('https://api.cntv.cn/lanmu/','');
  72. var link1 = 'https://api.cntv.cn/video/videoinfoByGuid?guid='+guid+'&serviceId=tvcctv';
  73. ctid = JSON.parse(request(link1)).ctid.replace('https://api.cntv.cn/lanmu/','');
  74. var link2 = 'https://api.cntv.cn/NewVideo/getVideoListByColumn?id='+ctid+'&d=&p=1&n=100&sort=desc&mode=0&serviceId=tvcctv&t=json';
  75. playUrls = JSON.parse(request(link2)).data.list;
  76. } else {
  77. playUrls = html.data.list;
  78. // 获取更多数据,暂不需要
  79. var flag = '';
  80. if(playUrls===''){
  81. flag = 'true';
  82. }
  83. var page = 1;
  84. while(flag===''){
  85. page = page+1;
  86. var burl = 'https://api.cntv.cn/NewVideo/getVideoListByAlbumIdNew?id='+ctid+'&serviceId=tvcctv&p='+page+'&n=100&mode='+modeMap[info[11]]+'&pub=1';
  87. var list = JSON.parse(request(burl)).data.list;
  88. if (list.length!==0){
  89. list.forEach(it => {
  90. playUrls.push(it);
  91. })
  92. continue;
  93. }else{
  94. flag='true';
  95. break;
  96. }
  97. }
  98. }
  99. let playFrom = [];
  100. let playList = [];
  101. playFrom.append('央视频');
  102. playUrls.forEach(it => {
  103. playList.append(playUrls.map(function(it) {
  104. return it.title + "$" + it.guid
  105. }).join("#"))
  106. });
  107. // 最后封装所有线路
  108. let vod_play_from = playFrom.join('$$$');
  109. let vod_play_url = playList.join('$$$');
  110. VOD['vod_play_from'] = vod_play_from;
  111. VOD['vod_play_url'] = vod_play_url;
  112. }),
  113. 搜索:'',
  114. }